<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set> 
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>选择仓库</title>

    <link rel="shortcut icon" href="${ctx}/favicon.ico"> <link href="${ctx}/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${ctx}/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="${ctx}/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="${ctx}/css/animate.css" rel="stylesheet">
    <link href="${ctx}/css/style.css?v=4.1.0" rel="stylesheet">

</head>
<body>
<form >
	<div style="text-algin:center;margin-top:30px;width:100%;height:50;">
		 <label  style="font-size:18px;width:220px;float:left;margin-top:5px;margin-left:20px;font-weight:normal;">为商品选择仓库：</label>
		<div style="width:150px;float:left;">
		    <select class="form-control" name="storehouse_id">
		        <c:forEach var="storehouse" items="${storehouseList}">
	                  <c:if test="${storehouse.storehouse_id==10}">
	                    		
	                   </c:if>
	                   <c:if test="${storehouse.storehouse_id!=10}">
	                    	<option value="${storehouse.storehouse_id}">${storehouse.storehouse_name}</option>
	                   </c:if>
	            </c:forEach>  
		    </select>
		</div>
		<div style="float:left;font-weight:700px;margin-left:10px;font-size:17px;" class="btn btn-sm btn-white" type="submit" onclick="inStorehouse(${purchase_id})">确定入库</div>
	</div>
</form>

    <%-- <div class="ibox-content" style="padding-top:70px;">
        <form class="form-horizontal">
            <div class="form-group">
                <label class="col-sm-2 control-label">选择仓库：</label>

                <div class="col-sm-2">
                    <select name="storehouse_id" class="form-control">
                    	<c:forEach var="storehouse" items="${storehouseList}">
                    		<c:if test="${storehouse.storehouse_id==10}">
                    		
                    		</c:if>
                    		<c:if test="${storehouse.storehouse_id!=10}">
                    			<option value="${storehouse.storehouse_id}">${storehouse.storehouse_name}</option>
                    		</c:if>
                    	</c:forEach>                      
                    </select>
                </div>
            </div>
            <div class="form-group" style="margin-top:30px;">
                <div class="col-sm-offset-4 col-sm-8">
                    <div class="btn btn-sm btn-white" type="submit" onclick="inStorehouse(${purchase_id})">确定入库</div>
                </div>
            </div>
        </form>
    </div> --%>
</body>
    <!-- 全局js -->
    <script src="${ctx}/js/jquery.min.js?v=2.1.4"></script>
    <script src="${ctx}/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="${ctx}/dist\layer-v3.1.1\layer\layer.js"></script>
    
    <script type="text/javascript">
    	function inStorehouse(purchase_id){
    		$.get('${ctx}/PurchaseServlet/inStorehouse?purchase_id='+purchase_id,$('form').serialize(),function(data){
    			if(data){	
    				alert("入库成功");
					//parent.layer.msg('入库成功');	
        			window.parent.location.reload();//刷新父页面
    				parent.layer.close(index);//关闭当前的弹窗
				}else{
					alert("入库失败");
					//parent.layer.msg('入库失败');
					window.parent.location.reload();//刷新父页面
					parent.layer.close(index);//关闭当前的弹窗
				}
        	});
    	}
    </script>
</html>